package com.javasea.web.junit.controller;

import com.javasea.web.junit.entity.User;
import com.javasea.web.junit.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ClassName HelloController
 * @Description TODO
 * @Author longxiaonan@163.com
 * @Date 2019/7/28 0028 0:54
 */
@RestController
@RequestMapping("/ts")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/list")
    public String list(User user){
        System.out.println("HelloController");
        userService.sayHello();
        return "hello";
    }

    @PostMapping("/save")
    public String save(@RequestBody User user){
        System.out.println("HelloController");
        userService.sayHello();
        return "hello";
    }

    @GetMapping("/get")
    public String list(){
        System.out.println("HelloController");
        userService.sayHello();
        return "hello";
    }
}
